package com.elock.service;

import java.util.Map;

import com.elock.base.core.Page;
import com.elock.base.core.Pageable;
import com.elock.base.core.service.BaseService;
import com.elock.entity.Member;

/**
 * 用户
 * @author 仁德
 */
public interface MemberService extends BaseService<Member> {

	/**
	 * 获取当前用户
	 * @return
	 */
	public Member getCurrent();

	/**
	 * 根据用户名查找用户
	 * @return
	 */
	public Member findByUsername(String username, Long companyInfoId);

	/**
	 * 根据手机号查找用户
	 * @param mobile
	 * @return
	 */
	public Member findByMobile(String mobile, Long companyInfoId);

	/**
	 * 保存
	 * @param member
	 * @param roleId
	 * @param saleOrgId
	 * @param isAdministrator
	 * @return
	 */
	public Long saveMember(Member member, Long[] roleId, Long saleOrgId,
			Boolean isAdministrator, Long[] terminalId);

	/**
	 * 更新
	 * @param member
	 * @param roleId
	 * @param saleOrgId
	 * @param isAdministrator
	 */
	public void updateMember(Member member, Long[] roleId, Long saleOrgId,
			Boolean isAdministrator, Long[] terminalId);

	/**
	 * 查找
	 * @param member
	 */
	public void updateInfo(Member member);

	public Page<Map<String, Object>> findPage(String username, String mobile, String name,
			String pinCode, Long saleOrgId, String startTime, String endTime,
			Integer memberType, Pageable pageable);

	public void deleteMember(Member member);

	public Member findByPinCode(String pinCode);
}
